package com.trt.eatmeat.test;

import java.util.HashMap;
import java.util.Map;

/**
 *  业务工具类
 */
public class BusinessOuter {
    /**
     * 内外请求get
     * @param
     * @param
     * @return
     */
    public Map<String,Object> login(String username,String password,String userCode){
        String url = ContantUtils.out_login;
        Map<String,Object> param = new HashMap<>();
        param.put("userName",username);
        param.put("password",password);
        param.put("code",userCode);
        Map<String,Object> response= HttpOAUtil.outPostJson(url, param);
        return response;
    }

    /**
     *  约餐
     * @param
     * @param userId
     * @param type
     * @return
     */
    public Map<String,Object> subscript(String userId,String code,int type){
        String url = ContantUtils.out_subscript;
        Map<String,Object> param = new HashMap<>();
        param.put("userId",userId);
        param.put("code",code);
        switch (type){
            case 1:
                param.put("type",0);
                param.put("val",0);
                break;
            case 2:
                param.put("type",0);
                param.put("val",1);
                break;
            case 3:
                param.put("type",1);
                param.put("val",0);
                break;
            case 4:
                param.put("type",1);
                param.put("val",1);
                break;
            default:
                break;
        }
        Map<String,Object> response= HttpOAUtil.outPostJson(url, param);
        return response;
    }



}
